package cn.codeforfun.common;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer;

import java.io.IOException;

/**
 * Created by Administrator on 2017/2/17 0017.
 */
public class HibernateLazyInitializerSerializer extends JsonSerializer<JavassistLazyInitializer> {
    @Override
    public void serialize(JavassistLazyInitializer javassistLazyInitializer, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
        jsonGenerator.writeNull();
    }
}
